﻿@inject IStringLocalizer<DialogPrintDialog> Localizer

<Button OnClick="@OnPrintDialogClick">@Localizer["PrintDialogButton"]</Button>

@code {
    [Inject]
    [NotNull]
    private DialogService? DialogService { get; set; }

    private int DataPrimaryId { get; set; } = 1;

    private async Task OnPrintDialogClick()
    {
        var op = new DialogOption()
        {
            Title = "Data query window",
            ShowPrintButton = true,
            ShowPrintButtonInHeader = true,
            ShowFooter = false,
            BodyContext = DataPrimaryId
        };
        op.Component = BootstrapDynamicComponent.CreateComponent<DataDialogComponent>();

        await DialogService.Show(op);
    }
}
